#ifndef __CE_LFQUEUE_H__
#define __CE_LFQUEUE_H__

#include "ce_core.h"

typedef struct {
    size_t                  qsize;
    size_t                  qhead;
    size_t                  qtail;

    ce_spinlock_t           lock;
    void                  **ringbuf;
} ce_lfqueue_t;

ce_lfqueue_t *ce_lfqueue_create(size_t size);
void ce_lfqueue_destroy(ce_lfqueue_t *lfq);

int ce_lfqueue_push(ce_lfqueue_t *lfq, void *data);
void *ce_lfqueue_pop(ce_lfqueue_t *lfq);

#endif
